<?php
/**
 * Created by PhpStorm.
 * User: yifeng
 * Date: 2018/3/20
 * Time: 21:56
 */

namespace app\blog\behavior;
use app\common\controller\Base;

class Login extends Base
{
//    public function run(&$params)
//    {
//        // 行为逻辑
//        $this->is_login();
//    }
//
//    public function is_login(){
//        $status = Base::isLogin();
//        if(!$status){
//            $this->redirect('index/Index/index');
//        }
//    }
    public function actionBegin(&$params)
    {
        $status = Base::isLogin();
        if(!$status){
            $this->redirect('index/Index/index');
        }
    }
}